const vuex = {
    namespaced: true,
    state: {
        d: 1,
        e: 2
    },
    getters: {
        adda(state) {
            // console.info("999")
            return state.d++
        }
    },
    mutations: {
        incrementMutations(state) {
            state.d++
            console.info("incrementMutations")
        }
    },
    actions: {// actions默認不是異步，可以通过async和new Promise返回异步
        incrementActions(context) {
            return new Promise((resolve, reject) => {
                console.info("incrementActions");
                resolve("执行成功");
            });
        },
         async incrementActions1(context) {
             await context.dispatch('incrementActions').then(result => {
                 console.info(result);
             });
            console.info("incrementActions1")
        }
    }
}

export default vuex;